package com.hxzy.mq;

import lombok.extern.log4j.Log4j2;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Author gityyge
 * @Description TODO
 * @Date 2023/8/10 9:05
 * @Version 1.0
 * topic: RocketMQ 主题
 * consumerGroup: 消费者组名称（通过相同名称构建消费者集群）
 */
@Log4j2
@Component
@RocketMQMessageListener(topic = "hxzy_test",consumerGroup = "testQueueConsumer",selectorExpression = "*")
public class HxzyQueueTagAConsumer implements RocketMQListener<String> {


    @Override
    public void onMessage(String message) {
       log.info(Thread.currentThread().getId()+",收到了话题为hxzy_test的，并且selectorExpression = \"*\"数据");
       log.info(Thread.currentThread().getId()+","+message);
    }
}
